Checks if there are characters in the receive buffer for a COM port.
To declare this function, include the following statement in the linkDLL control structure:
WORD isComRxReady(WORD)
<COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
The number of bytes in the receive buffer. If the receive buffer is empty, the number is 0.
to handle idle
if isComRxReady(1) > 0 then
put readComPort(1) after text of field "Input"
exampleHilite
isComTxReady
isComTxReady
isComTxReady
TBK-COMM.DLL
isComTxReady(<COM number>)
Checks if there is room in the transmit buffer for a COM port. You can use this function to avoid long waits because writeComPort will loop as long as necessary to avoid overrunning the output buffer.
To declare this function, include the following statement in the linkDLL control structure:
WORD isComTxReady(WORD)
<COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
The number of free bytes in the transmit buffer. If the transmit buffer is empty, the number is the same as the size of the buffer.
Caution: You must call closeComPort before exiting your application, otherwise the port remains unavailable to other applications and will remain unavailable even after you exit Windows.
To declare this function, include the following statement in the linkDLL control structure:
INT openComPort(WORD,WORD,WORD)
<COM number> is the number of the COM port you want to open, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
<Input Buffer Size> is the size of the input buffer the driver will reserve for this port. If <Input Buffer Size> is 0, a default buffer size of 1024 bytes will be assumed. Minimum buffer size is 32 characters; maximum i s 32767.
<Output Buffer Size> is the size of the output buffer the driver will reserve for this port. If <Output Buffer Size> is 0, a default buffer size of 128 bytes will be assumed. Minimum buffer size is 32 characters; maximum i s 32767.
A Windows device handle it successful, or a negative number if it failed
The Windows device handle is not used by the other functions in this DLL, but it is returned in case you need to reference the port in calls to other functions.
if openComPort(1,256,0) >= 0 then
request "COM1 opened successfully"
request "Could not open COM1"
end if
exampleHilite
setComPort
readComPort
readComPort
TBK-COMM.DLL
readComPort(<COM number>)
Reads the characters in the receive buffer for a COM port. Note: The received string will be truncated if it contains a character with a null value (ANSI character zero).
To declare this function, include the following statement in the linkDLL control structure:
STRING readComPort(WORD)
<COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
A string of characters. If the receive buffer was empty, a null string.
set Echo to readComPort(1)
exampleHilite
clearComBreak
clearComBreak
TBK-COMM.DLL
clearComBreak(<COM number>)
Suspends character transmission and places the transmission line in a break state until the clearComBreak function is called.
INT clearComBreak(WORD)
<COM number> is the number of the COM port you want to set, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
0 or a positive number if the function was successful
A negative number if the port is not open or if there is an unspecified error.
if get SetComBreak(PortNo) >= 0
pause 30 -- .3 seconds
get ClearComBreak(PortNo)
exampleHilite
writeComPort
setComBreak
setComBreak
TBK-COMM.DLL
setComBreak(<COM number>)
Restores character transmission suspended by a call to setComBreak and places the transmission line in a nonbreak state.
INT clearComBreak(WORD)
<COM number> is the number of the COM port you want to set, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
0 or a positive number if the function was successful
A negative number if the port is not open or if there is an unspecified error.
if get SetComBreak(PortNo) >= 0
pause 30 -- .3 seconds
get ClearComBreak(PortNo)
exampleHilite
8Z \ \
TBK-COMM.DLL
clearComBreak Suspends character transmission and places the transmission line in a break state until the clearComBreak function is called.
closeComPort Closes the port designated by <COM number>. If the port was not opened, the function has no effect.
flushComRxBuffer Flushes out any characters in the receive buffer for a COM port. The characters are lost.
flushComTxBuffer Flushes out any characters in the transmit buffer for a COM port. The characters are lost.
isComRxReady Checks if there are characters in the receive buffer for a COM port.
isComTxReady Checks if there is room in the transmit buffer for a COM port. You can use this function to avoid long waits because writeComPort will loop as long as necessary to avoid overrunning the output buffer.
openComPort Opens a serial port for communications.
readComPort Reads the characters in the receive buffer for a COM port. Note: The received string will be truncated if it contains a character with a null value (ANSI character zero).
setComBreak Restores character transmission suspended by a call to setComBreak and places the transmission line in a nonbreak state.
setComPort Sets the parameters for a COM port. The port must have been previously opened with openComPort. SetComPort will also reset the port completely, if possible.
setComPortTxXlate Turns on or off the translation of transmitted escape character sequences for the specified port. The port must be open. By default, this setting is off when you open the port. Since you cannot embed null characters in an OpenScript string, this allows you to embed escape sequences that will be transmitted as nulls. Note that the second character in \0 is the digit zero, not an uppercase o.
TBK_COMMVersion Returns a string containing the name of the DLL, the version number and the date this version was compiled.
writeComPort Writes <output> to the transmit buffer of a COM port. Note: There is currently no way to transmit nulls. This capability will be added in a future version.
This DLL contains functions to control up to 4 serial ports and communicate through them.
Sets the parameters for a COM port. The port must have been previously opened with openComPort. SetComPort will also reset the port completely, if possible.
To declare this function, include the following statement in the linkDLL control structure:
INT setComPort(WORD,WORD,WORD,WORD,WORD,WORD)
<COM number> is the number of the COM port you want to set, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
<baud> is the baud rate; it can be any baud rate supported by Windows and the COM port hardware, typically 110, 300, 600, 1200, 2400, 4800, 9600 or 19200.
<byte size> is the number of bits in each transmitted character, typically 7 or 8.
<stop bits> is the number of stop bits that follow a transmitted character.
<parity> is 0 for no parity, 1 for odd parity and 2 for even parity.
<handshake> is 0 for no handshaking, 1 for hardware handshaking, or 2 for Xon/Xoff handshaking. When hardware handshaking is used, RTS is used for transmit flow control and DTR is used for receive flow control. Both are set to time out after 4 seconds.
0 or a positive number if the function was successful
-1 if the port is not open or if there is an unspecified error.
-202 if the <baud> rate is invalid
-203 if the <byte size> parameter is invalid
-204 if the <stop bits> parameter is invalid
-205 if the <parity> parameter is invalid
-206 if the <handshake> parameter is invalid
get openComPort(1, 0, 0) -- Open COM1 with default buffer sizes
if it >= 0 then
get setComPort(1, 9600, 8, 1, 0, 0) -- 9600 baud, no parity, no handshake
if it < 0 then
request "Could not open COM1"
exampleHilite
setComPortTxXlate
exampleHilite
setComPortTxXlate
TBK-COMM.DLL
setComPortTxXlate(<COM number>,<on/off>)=
Turns on or off the translation of transmitted escape character sequences for the specified port. The port must be open. By default, this setting is off when you open the port. Since you cannot embed null characters in an OpenScript string, this allows you to embed escape sequences that will be transmitted as nulls. Note that the second character in \0 is the digit zero, not an uppercase o.
Supported escape sequewnces
Character sequence transmitted as Hexadecimal equivalent
\0 null 00h
\a bell (Alert) 07h
\b backspace 08h
\f form feed 0Eh
To declare this function, include the following statement in the linkDLL control structure:
INT setComPortTxXlate(WORD,WORD)
<COM number> is the number of the COM port you want to set, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
<on/off> is 1 to turn the translation on, 0 to turn it off. .
0 or a positive number if the function was successful
A negative number if the port is not open or if there is an unspecified error.
get openComPort(1, 0, 0) -- Open COM1 with default buffer sizes
if it >= 0 then
get setComPort(1, 9600, 8, 1, 0, 0) -- 9600 baud, no parity, no handshake
get setComPortTxXlate(1,1) -- turn on translation of /0, etc.
if it < 0 then
request "Could not open COM1"
-- transmit a few nulls
get writeComPort(1, "\0\0\0\0\0\0\0\0\0\0\0")
-- now transmit ssome normal characters, but make the other terminal beep too
get writeComPort(1, "Hello, anyone there?\a" & CRLF)
his pa,.
TBK_COMMVersion
TBK_COMMVersion
TBK-COMM.DLL
TBK_COMMVersion()
Returns a string containing the name of the DLL, the version number and the date this version was compiled.
STRING TBK_COMMVersion()
None.
A string in the form "TBK-COMM.DLL Version 1.0 4/1/90"
TBK_COMMVersion
flushComTxBuffer
writeComPort
writeComPort
TBK-COMM.DLL
writeComPort(<COM number>,<output>)
Writes <output> to the transmit buffer of a COM port. Note: There is currently no way to transmit nulls. This capability will be added in a future version.
To declare this function, include the following statement in the linkDLL control structure:
INT writeComPort(WORD, STRING)
<COM number> is the number of the COM port you want to write to, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
<output> is anything that evaluates to a string. If it has a numeric value, the string representation of that value is sent.
The number of characters actually placed in the transmit queue. If there was an error, the function returns a negative number. Expect the following values:
-1 if the port is not open or there is another unspecified error
-16 if a break was detected
-32 if a CTS time out was detected
-64 if a DSR time out was detected
- 256 if the transmit queue was full while trying to queue a character (internal DLL error).
if writeComPort(1, "Hello there" & CR) > 0 then
request "It worked!"
end if
exampleHilite
clearComBreak
closeComPort
setComPortTxXlate
flushComRxBuffer
TBK-COMM.DLL Reference page
Main List
removeRecords
Main List
copyFile
displayAspectY
lastDBRecord
displayAspectXY
DLL descriptions
System
s Rmn
saveDate
60,87.625,100
J 1990
March 8, 1990
defcolor
TBK-COMM.DLL Reference
L Help
S:CONDITIONDATA
subtitle is "TBKWIN.DLL"
(S:REPORTDATA
Atrue
AVBtrue
AVBtrue
AVBtrue
AVBtrue
text of recordfield "DLL" is in "TBKWIN.DLL"
text of recordfield "DLL" is in "TBKWIN.DLL"
text of recordfield "DLL" is in "TBKWIN.DLL"
Intro Text
Function List
nelds
which
:PRINTLAYOUT
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
false
March 27, 1990
March 27, 1990
Intro Text
Function List
"DLL" is in "TBKWIN.DLL"
text of recordfield "DLL" is in "TBKWIN.DLL"
text of recordfield "DLL" is in "TBKWIN.DLL"
text of recordfield "DLL" is in "TBKWIN.DLL"
text of recordfield "DLL" is in "TBKWIN.DLL"
text of recordfield "DLL" is in "TBKFILE.DLL"
text of recordfield "DLL" is in "TBKFILE.DLL"
text of recordfield "DLL" is in "tbkfile"
text of recordfield "DLL" is in "tbkfile"
text of recordfield "DLL" is in "tbkfile.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
text of recordfield "DLL" is in "tbkfile.dll"
text of recordfield "DLL" is in "tbkwin.dll"
text of recordfield "DLL" is in "tbkwin.dll"
text of recordfield "DLL" is in "tbkwin.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
_B|B|
Parameters
Returns
Example
n "tbkwin.dll"
text of recordfield "DLL" is in "tbkwin.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
text of recordfield "DLL" is in "tbkdb3.dll"
wtrue
Qtext of recordfield "DLL" is in "TBKDB3.DLL"
Qtext of recordfield "DLL" is in "TBKDB3.DLL"
Rtrue
Strue
Rxt of recordfield "DLL" is in "TBKDB3.DLL"
PdefaultColor
P0,100,0
{300,50,100
{0,50,100
0,75.6875,0
P60,87.625,100
March 9, 1990
March 16, 1990
March 16, 1990
c"&Edit"
c"&Clipboard"
"Copy LinkDLL statement"
%Example"
deActivate
"CopyLinkDLLstatement"
"&Author" &
9& "F3"
c"Help"
"About This Book..."
c"&Special"
"Print &
6Page"
Summary..."
=Function Encyclopedia..."
"Background Color..."
odefaultColor
backgroundColor
"Pick a fill color
tray."
AboutThisBook
8:" & CRLF \
& "ToolBook standard
function reference." &
& "Version 1.0 -"\
&& saveDate
setPrintDefaults
360,360
1440,1440,1440,1440
PrintThisPage
PrintFunctionEncyclopedia
Pages"
printDLLSummary
PrintDLLSummary
descriptions"
stamp
SaveAs
"M d, y"
odefcolor
4switchingLevels
lockFields
Descriptions",
setAuthor
which, how
-- locks
unlocks
fields
a list
-- recursive
encountering a
that may contain
ClearBook
will
contents
f"OK"
"Cancel"
"OK"
"DLL"
"Syntax"
"Returns"
"Parameters"
List"
"Subtitle"
"Intro Text"
"Main
trim s
s <>
cs <>
< 32
s <>
cs <>
s) <= 32
-- filter non-
assorted funky
", s)
p > 0
cp > 0
", s)
", s) = 1
Appending
"Are you sure
want
f"Yes"
showImportHelp
("Name
file (type
should appear
titles):"
c"."
~(".",
) - 1
("File
ffN & ".TXT"
sendaux(
pcount
isTitle
isSyntax
isDescr
isTReturns
isParameters
isExample
WaitingForIntro
IntroTag
(165) & "_"
NewPage
theLine
leading LF
a)) > 1
SetDLLIntroTxt dfN,
<> "Examples"
update numbers
"ImportFListHelp"
setDLLIntroTxt dllName, txt
oldPg
"Do a complete
findExamples
", \
-- Update
front
"Sort
fList
"Done.
UpdateDLLPages
sysSuspendMessages
oldPage
dList
-- We now have a
functions
their
DLLList
dName
fName
"What can
" &&
Lmax
cL = 0
j <=
L = 0 --
"Adding" &&
" &&
4s_searchString
("Search
selectedTextState
"Cannot
" &&
& "."
cyclopedia
printDLLSummary
enterbackground
SaveAs
stamp
leaveBook
first
AboutThisBook
previous
printpages
setPrintDefaults
reader
keydown
enterBook
setAuthor
author
PrintThisPage
lockFields
ClearBook
backgroundColor
import
showImportHelp
setDLLIntroTxt
PrintFunctionEncyclopedia
UpdateDLLPages
search
enterBook
reader
sizetopage
newPage
import
&Edit
&Clipboard
Copy LinkDLL statement
Clipboard
Copy Example
Clipboard
CopyLinkDLLstatement
Copy Example
&Author
About This Book...
&Special
Print &This Page
Special
Print &DLL Summary...
Special
Print &Function Encyclopedia...
Special
Special
Background Color...
Special
defaultColor
leaveBook
backgroundColor
Pick a fill color for the background from the color tray.
defaultColor
enterbackground
defaultColor
defaultColor
AboutThisBook
About this book:
ToolBook standard DLL function reference.
Version 1.0 -
saveDate
setPrintDefaults
PrintThisPage
setPrintDefaults
PrintFunctionEncyclopedia
oPrintFunctionEncyclopedia
Function Pages
printDLLSummary
PrintDLLSummary
DLL descriptions
stamp
SaveAs
stamp
stamp
M d, y
saveDate
default
first
default
previous
default
default
printpages
defcolor
defcolor
defcolor
reader
lockFields
Function Pages
lockFields
DLL Descriptions
default
switchingLevels
keydown
setAuthor
switchingLevels
setAuthor
lockFields
Function Pages
lockFields
DLL Descriptions
default
switchingLevels
author
setAuthor
lockFields
field
group
lockFields
which
ClearBook
This will clear the contents of all the pages in the book.
Cancel
Function Pages
clear
Function
Syntax
Description
Returns
Example
Parameters
DLL Descriptions
clear
Function List
Subtitle
Intro Text
Main List
Main List
default
import
Function
Function Pages
Are you sure you want to import?
Cancel
showImportHelp
Name of DLL file (type name as it should appear in titles):
File to import:
Function Pages
end of file
y5NewPage
end of file
SetDLLIntroTxt
y5newPage
Function
Syntax
Description
Parameters
Returns
Example
Function~
title
Syntax
Description
Parameters
Returns
Example
Examples
end of file
y5newPage
Function
Syntax
Description
Parameters
Returns
Example
enterbackground
theLine
IntroTag
WaitingForIntro
Example
Parameters
TReturns
Descr
Syntax
Title
isExample
isParameters
isTReturns
isDescr
isSyntax
isTitle
pcount
default
count
Appending
/ TH' i
showImportHelp
ImportFListHelp
setDLLIntroTxt
DLL Descriptions
y5newPage
Intro text
oldPg
dllName
DLL Descriptions
Do a complete sort and update of the book?
Function Pages
enterbackground
findExamples
Function
Sort complete. Update Main Function List?
Function
Main List
Main List
Done. Update DLL Description Pages?
kUpdateDLLPages
default
fList
UpdateDLLPages
DLL descriptions
DLL descriptions
DLLList
DLLList
DLL descriptions
y5newPage
What can the functions in
Function list
Adding
to page
Description
Function list
fName
dName
dList
oldPage
fList
search
Search for:
Cancel
Cannot find
s_searchString
60,87.625,100
ldPage
fList
search
Search for:
Cancel
Cannot find
s_searchString
Qtext of recordfield "DLL" is in "TBKDB3.DLL"
Rtext of recordfield "DLL" is in "TBKDB3.DLL"
Rtrue
Rtrue
Rtrue
Intro Text
Function List
-- 3/27/90 Claude O.
c"&Edit"
c"&Clipboard"
"Copy &LinkDLL Statement"
&All
&s For This
MExample"
deActivate
"CopyLinkDLLstatement"
"CopyAllLinkDLLStatementsForThisDLL"
"&Author" &
9& "F3"
c"Help"
"About
Book..."
c"&Special"
"Print &
Page"
ummary..."
=Function Encyclopedia..."
"Background Color..."
odefaultColor
backgroundColor
"Pick a fill color
tray."
AboutThisBook
8:" & CRLF \
& "Version 1.0 -"\
&& saveDate
setPrintDefaults
360,360
1440,1440,1440,1440
PrintThisPage
PrintFunctionEncyclopedia
Pages"
printDLLSummary
PrintDLLSummary
descriptions"
CopyAllStatements
stamp
SaveAs
"M d, y"
odefcolor
4switchingLevels
lockFields
Descriptions",
setAuthor
which, how
-- locks
unlocks
fields
a list
-- recursive
encountering a
that may contain
ClearBook
will
contents
f"OK"
"Cancel"
"OK"
"Syntax"
"Returns"
"Parameters"
List"
"Subtitle"
"Intro Text"
"Main
trim s
s <>
cs <>
< 32
s <>
cs <>
s) <= 32
-- filter non-
assorted funky
", s)
p > 0
cp > 0
", s)
", s) = 1
Appending
"Are you sure
want
f"Yes"
showImportHelp
("Name
file (type
should appear
titles):"
c"."
~(".",
) - 1
("File
ffN & ".TXT"
sendaux(
pcount
isTitle
isSyntax
isDescr
isTReturns
isParameters
isExample
WaitingForIntro
IntroTag
(165) & "_"
NewPage
theLine
leading LF
a)) > 1
SetDLLIntroTxt dfN,
<> "Examples"
update numbers
"ImportFListHelp"
setDLLIntroTxt dllName, txt
oldPg
"Do a complete
findExamples
", \
-- Update
front
"Sort
fList
"Done.
UpdateDLLPages
sysSuspendMessages
oldPage
dList
-- We now have a
functions
their
DLLList
dName
fName
"What can
" &&
Lmax
cL = 0
j <=
L = 0 --
"Adding" &&
" &&
4s_searchString
("Search
selectedTextState
"Cannot
" &&
& "."
printDLLSummary
CopyAllLinkDLLStatementsForThisDLL
enterbackground
SaveAs
stamp
leaveBook
AboutThisBook
first
previous
setPrintDefaults
printpages
reader
enterBook
keydown
setAuthor
PrintThisPage
author
lockFields
backgroundColor
ClearBook
import
showImportHelp
PrintFunctionEncyclopedia
setDLLIntroTxt
UpdateDLLPages
search
enterBook
reader
sizetopage
newPage
import
&Edit
&Clipboard
Copy &LinkDLL Statement
Clipboard
Copy &All LinkDLL Statements For This DLL
Clipboard
Copy &Example
Clipboard
CopyLinkDLLstatement
CopyAllLinkDLLStatementsForThisDLL
Copy Example
&Author
About This Book...
&Special
Print &This Page
Special
Print &DLL Summary...
Special
Print &Function Encyclopedia...
Special
Special
Background Color...
Special
defaultColor
leaveBook
backgroundColor
Pick a fill color for the background from the color tray.
defaultColor
defaultColor
enterbackground
defaultColor
defaultColor
AboutThisBook
About this book:
Version 1.0 -
saveDate
setPrintDefaults
PrintThisPage
setPrintDefaults
PrintFunctionEncyclopedia
oPrintFunctionEncyclopedia
Function Pages
printDLLSummary
PrintDLLSummary
DLL descriptions
CopyAllLinkDLLStatementsForThisDLL
CopyAllStatements
Function Pages
stamp
SaveAs
stamp
stamp
M d, y
saveDate
default
first
default
previous
default
default
printpages
defcolor
defcolor
defcolor
reader
lockFields
Function Pages
lockFields
DLL Descriptions
default
switchingLevels
keydown
setAuthor
switchingLevels
setAuthor
lockFields
Function Pages
lockFields
DLL Descriptions
default
switchingLevels
author
setAuthor
lockFields
field
group
lockFields
which
ClearBook
This will clear the contents of all the pages in the book.
Cancel
Function Pages
clear
Function
Syntax
Description
Returns
Example
Parameters
DLL Descriptions
clear
Function List
Subtitle
Intro Text
Main List
Main List
default
import
Function
Function Pages
Are you sure you want to import?
Cancel
showImportHelp
Name of DLL file (type name as it should appear in titles):
File to import:
Function Pages
end of file
y5NewPage
end of file
SetDLLIntroTxt
y5newPage
Function
Syntax
Description
Parameters
Returns
Example
Function~
title
Syntax
Description
Parameters
Returns
Example
Examples
end of file
y5newPage
Function
Syntax
Description
Parameters
Returns
Example
enterbackground
theLine
IntroTag
WaitingForIntro
Example
Parameters
TReturns
Descr
Syntax
Title
isExample
isParameters
isTReturns
isDescr
isSyntax
isTitle
pcount
default
count
Appending
/ TH' i
showImportHelp
ImportFListHelp
setDLLIntroTxt
DLL Descriptions
y5newPage
Intro text
oldPg
dllName
DLL Descriptions
Do a complete sort and update of the book?
Function Pages
enterbackground
findExamples
Function
Sort complete. Update Main Function List?
Function
Main List
Main List
Done. Update DLL Description Pages?
kUpdateDLLPages
default
fList
UpdateDLLPages
DLL descriptions
DLL descriptions
DLLList
DLLList
DLL descriptions
y5newPage
What can the functions in
Function list
Adding
to page
Description
Function list
fName
dName
dList
oldPage
fList
search
Search for:
Cancel
Cannot find
s_searchString
Function Pages
setPrintDefaults
odefPrinterFields
odefPrinterFieldWidths
PrintFunctionEncyclopedia
oldp
5 Pages"
functions,
only those
specific DLL(s)?" \
f"All"
"Some"
"Cancel"
printIt
summary
which
`& CRLF\
& "Example: TBKWIN.
}, TBKFILE.
fDLLList
) > 1
c".")
& ".dll"
x(trim(
) = 1
x("."
Cancelled
"does
xmatch the DLLs described
" &&\
E" &
" &&
printreport
ofirstP
olastP
"CopyLinkDLLstatement"
"CopyAllLinkDLLStatementsForThisDLL"
deActivate
_nt"
"CopyExample"
CopyLinkDLLStatement
"dummy"
" & \
"Description" &
CopyAllStatements
X" &&
s0 &
X" &
default
B"Previous"
B"Next"
fixScroll
"Syntax"
"Parameters"
"Returns"
resetFieldSizes
"Help"
x > 0
expandSyntax
1425,870,8610,5490
oexpSyntax
expandDescription
1425,870,8610,5490
oexpDescription
expandParameters
1425,870,8610,5490
oexpParameters
expandReturns
1425,870,8610,5490
oexpReturns
1425,870,8610,1525
1425,1565,8610,3075
1425,3105,8610,4350
1425,4385,8610,5510
findExamples
srch
Lmax
cL = 0
i <= LMax
<> "-"
<> " "
"example"
& " "
L > 0
exampleHilite
CopyLinkDLLStatement
PrintFunctionEncyclopedia
CopyAllStatements
CopyExample
enterPage
leavePage
fixScroll
printIt
setPrintDefaults
previous
author
expandSyntax
enterbackground
expandDescription
expandParameters
leaveBackground
expandReturns
resetFieldSizes
findExamples
setPrintDefaults
defPrinterFields
defPrinterFieldWidths
PrintFunctionEncyclopedia
Function Pages
setPrintDefaults
Print all functions, or only those of specific DLL(s)?
How to use the DLL Help function description pages:
Use the arrow buttons to navigate from function to function in alphabetical order.
Click Example to see one or more examples of usage of the function. The Example button remains hidden if there is no example.
If there is more text in a field than you can read comfortably, click the name of the field to expand it. When a field is expanded, its name is highlighted. Click the field name again to return it to its normal size, or click another field name to expand that other field. Field sizes are reset automatically when you go to another page.
Click Main List for the list of all functions, or Function List For This DLL for a list of all the functions that are available in the same DLL as the function described on this page. The function list for the DLL also contains a short description of the DLL organization and usage.
Use the command "Copy LinkDLL Statement" in the edit menu to copy the linkDLL statement for the function on this page onto the clipboard. You will then be able to paste it into a ToolBook script and avoid retyping errors.
Syntax
expSyntax
resetFieldSizes
expandSyntax
default
buttonUp
buttonUp
expSyntax
resetFieldSizes
9expandSyntax
default
false
closeComPort
closeComPort
TBK-COMM.DLL
closeComPort(<COM number>)
Closes the port designated by <COM number>. If the port was not opened, the function has no effect.
To declare this function, include the following statement in the linkDLL control structure:
INT closeComPort(WORD)
<COM number> is the number of a COM port.
If no error occurs, the function returns a positive number. If there was an error, it returns 0.
get closeComPort(1) -- Close COM1
exampleHilite
DLL descriptions
rectory
ofirstP
olastP
"CopyAllLinkDLLStatementsForThisDLL"
deActivate
"Help"
setPrintDefaults
odefPrinterFields
odefPrinterFieldWidths
PrintDLLSummary
oldp
descriptions"
summary
DLLs,
specific
l(s)?" \
f"All"
"Some"
"Cancel"
printIt
which
(s)?" & CRLF\
& "Example: TBKWIN.
, TBKFILE.
fDLLList
) > 1
c".")
& ".dll"
x(trim(
) = 1
x("."
Cancelled
"does
xmatch the
described
" &&\
" &&
printreport --
Xsettings
/"DLL
4s_interest
"Function
L > 0
znothing
{Info"
default
B"Previous"
B"Next"
Lmax
cL = 0
i <= LMax
L > 0
"Intro
Pages"
enterbackground
setPrintDefaults
PrintDLLSummary
printIt
leaveBackground
buttonDown
buttonDoubleClick
enterpage
leavePage
import
enterbackground
firstP
lastP
CopyAllLinkDLLStatementsForThisDLL
leaveBackground
CopyAllLinkDLLStatementsForThisDLL
leavePage
setPrintDefaults
defPrinterFields
defPrinterFieldWidths
PrintDLLSummary
DLL descriptions
setPrintDefaults
Print summary for all DLLs, or for specific DLL(s)?
Cancel
JRprintIt
Print summary for which DLL(s)?
Example: TBKWIN.DLL, TBKFILE.DLL
DLLList
DLLList
DLLList
Cancel
Cancel
does not match the DLLs described in this book:
DLLList
text of recordfield
is in
JRprintIt
Cancelled
i:to3
printIt
DLL descriptions
buttonDown
Function List
textFromPoint
button
Function Info
s_interest
buttonDoubleClick
buttonUp
Function Info
s_interest
enterpage
Function Info
Previous
firstP
lastP
Function List
Function List
Intro text
default
s_interest
import
Function Pages
!import
defPrinterFieldWidths
9315,9315,9315
defPrinterFields
DLL,Intro Text,Function List
lastP
firstP
dummy
Function: Summary::
Function Info
-- assumes that
will only be able
-- the function list
Hclicking
4s_interest
<>
default
buttonUp
buttonUp
default
s_interest
Info on Selected Function
"Help"
buttonUp
buttonUp
Intro Text
Function List
Subtitle
buttonUp
buttonUp
Go Back
buttonUp
buttonUp
first
Main List
Previous
buttonUp
buttonUp
previous
buttonUp
buttonUp
Function info
buttonUp
buttonUp
Example
How to use the DLL Description pages
Use the arrow buttons to navigate from DLL to DLL in alphabetical order.
Click Main List for the list of all functions, or click a function name then Info on Selected Function to go to the details page for that function. You can also double-click a function name for the same result.
Using DLL functions
Before you can call the functions in a DLL from a script, you must first link the DLL to ToolBook and declare the functions you want to use with the linkDLL control structure.
For details, see Appendix B, "Using DLLs with ToolBook," in the Using OpenScript manual.eset automatically when you go to another page.
. Field sizes are reset automatically when you go to another page.
on described on this page. The function list for the DLL also contains a short description of the DLL organization and usage.
usage.
and usage.
TBK_COMMVersion
Function Pages
flushComRxBuffer
flushComRxBuffer
TBK-COMM.DLL
flushComRxBuffer(<COM number>)
Flushes out any characters in the receive buffer for a COM port. The characters are lost.
To declare this function, include the following statement in the linkDLL control structure:
INT flushComRxBuffer(WORD)
<COM number> is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
0 if failed, a positive number if successful.
get flushComRxBuffer(1) -- Flush receive queue of COM1
exampleHilite
Main List
z) > 1
"PrintThisPage"
x <>
4s_interest
"Main List"
L > 0
-- ignore
"DLL Info"
"Function
Lmax
cL = 0
i <= LMax
L > 0
default
Pages"
ebackground
keydown
enterbackground
buttonDown
buttonDoubleClick
enterpage
leavebackground
import
enterbackground
go back
PrintThisPage
leavebackground
Print This Page
keydown
buttonDown
Main List
textFromPoint
button
field
DLL Info
Function Info
s_interest
buttonDoubleClick
buttonUp
Function Info
s_interest
enterpage
Main List
Main List
DLL Info
Function Info
default
s_interest
import
Function Pages
!import
go back
buttonUp
buttonUp
Go Back
Main List
Main List
clearComBreak TBK-COMM.DLL
closeComPort TBK-COMM.DLL
flushComRxBuffer TBK-COMM.DLL
flushComTxBuffer TBK-COMM.DLL
isComRxReady TBK-COMM.DLL
isComTxReady TBK-COMM.DLL
openComPort TBK-COMM.DLL
readComPort TBK-COMM.DLL
setComBreak TBK-COMM.DLL
setComPort TBK-COMM.DLL
setComPortTxXlate TBK-COMM.DLL
TBK_COMMVersion TBK-COMM.DLL
writeComPort TBK-COMM.DLL
This book documents the functions contained in the file TBK-COMM.DLL. Use at your own risk.made as to the
Serial Port DLL Function Reference
4s_interest
buttonUp
buttonUp
s_interest
Info on Selected DLL
Function Info
4s_interest
buttonUp
buttonUp
s_interest
Info on Selected Function
"help"
buttonUp
buttonUp
Version
Copyright
Asymetrix Corporation 1989, 1990 -- Version 1.0
/"function
buttonUp
buttonUp
function pages
Browse All Functions
DLL info
Function info
)18\4
/"DLL Descriptions"
buttonUp
buttonUp
DLL Descriptions
Browse DLL Descriptions
buttonUp
buttonUp
To use this book:
Click on the name of a function to select it, then click one of the buttons on the right for details about the function or details about the DLL in which it is available. You can also double-click a function name to go to that function directly.
To use DLL functions:
You must have "linked in" the function before you can call it in your script. To link in a function, use a statement in the following form:
If you make any mistake in the linkDLL statement, it may lead to a system crash when the function is called. For more information, see the OpenScript documentation. You can use the Copy LinkDLL Statement command in the Clipboard menu to save typing time and avoid errors.
setComBreak
Importing into the "Function by function" background
Import is from an ASCII file, where records and fields are identified by a specific tag at the beginning of the line:
"?" for function name
"!" for syntax
"#" for description
";" for parameters
":" for what the function returns
"$" for example
Each of the above "fields" can contain empty lines and line breaks.
The tag can be inserted as "invisible" style characters in a Microsoft word file. The easiest way to do this is to make them glossary entries and insert it into the file.
Sorting must be done manually after the import is complete. Be sure to check the "Example" field of the last imported field for garbage before you sort.
C.O. 12/14/89null then
set Title to theLine
else
set Title to Title & CRLF & theLine
end if
end if
if isSyntax and theLine <> "Syntax"
if Syntax is null then
set Syntax to theLine
else
set Syntax to Syntax & CRLF & theLine
end if
end if
if isDescr and theLine <> "Description"
if Descr is null then
set Descr to theLine
else
set Descr to Descr & CRLF & theLine
end if
end if
if isParameters and theLine <> "Parameters" then
if Parameters is null then
set Parameters to theLine
else
set Parameters to Parameters & CRLF & theLine
end if
end if
if isTReturns and theLine <> "Returns" then
if TReturns is null then
set TReturns to theLine
else
set TReturns to TReturns & CRLF & theLine
end if
end if
if isExample and theLine <> "Example" and \
theLine <> "Examples" then
if Example is null then
set Example to theLine
else
set Example to Example & CRLF & theLine
end if
end if
Parameters is null then
set Parameters to theLine
else
set Parameters to Parameters & CRLF & theLine
end if
end if
if isTReturns and theLine <> "Returns" then
if TReturns is null then
set TReturns to theLine
else
set TReturns to TReturns & CRLF & theLine
end if
end if
if isExample and theLine <> "Example" and \
theLine <> "Examples" then
if Example is null then
set Example to theLine
else
set Example to Example & CRLF & theLine
end if
end if
end if
end if
if isParameters and theLine <> "Parameters" then
if Parameters is null then
set Parameters to theLine
else
set Parameters to Parameters & CRLF & theLine
end if
end if
if isTReturns and theLine <> "Returns" then
if TReturns is null then
set TReturns to theLine
else
set TReturns to TReturns & CRLF & theLine
end if
end if
if isExample and theLine <> "Example" and \
theLine <> "Examples" then
if Example is null then
set Example to theLine
else
set Example to Example & CRLF & theLine
end if
end if
set Syntax to Syntax & CRLF & theLine
end if
end if
if isDescr and theLine <> "Description"
if Descr is null then
set Descr to theLine
else
set Descr to Descr & CRLF & theLine
end if
end if
if isParameters and theLine <> "Parameters" then
if Parameters is null then
set Parameters to theLine
else
set Parameters to Parameters & CRLF & theLine
end if
end if
if isTReturns and theLine <> "Returns" then
if TReturns is null then
set TReturns to theLine
else
set TReturns to TReturns & CRLF & theLine
end if
end if
if isExample and theLine <> "Example" and \
theLine <> "Examples" then
if Example is null then
set Example to theLine
else
set Example to Example & CRLF & theLine
end if
end if
end if
buttonUp
buttonUp
Go Back
ImportFListHelp
flushComTxBuffer
flushComTxBuffer
TBK-COMM.DLL
flushComTxBuffer(<COM number>)
Flushes out any characters in the transmit buffer for a COM port. The characters are lost.
To declare this function, include the following statement in the linkDLL control structure:
INT flushComTxBuffer(WORD)
<COM number>is the number of the COM port you want to check, such as 1 for COM1, 2 for COM2, etc. The maximum allowable value is 4.
0 if failed, a positive number if successful.
get flushComTxBuffer(1) -- Flush transmit queue of COM1